/*
 * areas.h
 *
 *  Created on: 15.06.2012
 *      Author: kreyl
 */

#ifndef AREAS_H_
#define AREAS_H_

#include <stdint.h>

struct Area_t {
    uint8_t Indx;
    int32_t BLLatitude, BLLongitude, TRLatitude, TRLongitude;
};

#define AREA_LAT_COUNT  8
#define AREA_LNG_COUNT  11
#define AREA_COUNT      (AREA_LAT_COUNT*AREA_LNG_COUNT)

const Area_t Area[AREA_LAT_COUNT][AREA_LNG_COUNT] = {
{
     {0,     555218020,    363333030,    555223941,    363343260},
     {1,     555218020,    363343260,    555223941,    363353490},
     {2,     555218020,    363353490,    555223941,    363363720},
     {3,     555218020,    363363720,    555223941,    363373950},
     {4,     555218020,    363373950,    555223941,    363384180},
     {5,     555218020,    363384180,    555223941,    363394410},
     {6,     555218020,    363394410,    555223941,    363404640},
     {7,     555218020,    363404640,    555223941,    363414870},
     {8,     555218020,    363414870,    555223941,    363425100},
     {9,     555218020,    363425100,    555223941,    363435330},
     {10,     555218020,    363435330,    555223941,    363445560},
},
{
     {11,     555223941,    363333030,    555229862,    363343260},
     {12,     555223941,    363343260,    555229862,    363353490},
     {13,     555223941,    363353490,    555229862,    363363720},
     {14,     555223941,    363363720,    555229862,    363373950},
     {15,     555223941,    363373950,    555229862,    363384180},
     {16,     555223941,    363384180,    555229862,    363394410},
     {17,     555223941,    363394410,    555229862,    363404640},
     {18,     555223941,    363404640,    555229862,    363414870},
     {19,     555223941,    363414870,    555229862,    363425100},
     {20,     555223941,    363425100,    555229862,    363435330},
     {21,     555223941,    363435330,    555229862,    363445560},
},
{
     {22,     555229862,    363333030,    555235783,    363343260},
     {23,     555229862,    363343260,    555235783,    363353490},
     {24,     555229862,    363353490,    555235783,    363363720},
     {25,     555229862,    363363720,    555235783,    363373950},
     {26,     555229862,    363373950,    555235783,    363384180},
     {27,     555229862,    363384180,    555235783,    363394410},
     {28,     555229862,    363394410,    555235783,    363404640},
     {29,     555229862,    363404640,    555235783,    363414870},
     {30,     555229862,    363414870,    555235783,    363425100},
     {31,     555229862,    363425100,    555235783,    363435330},
     {32,     555229862,    363435330,    555235783,    363445560},
},
{
     {33,     555235783,    363333030,    555241704,    363343260},
     {34,     555235783,    363343260,    555241704,    363353490},
     {35,     555235783,    363353490,    555241704,    363363720},
     {36,     555235783,    363363720,    555241704,    363373950},
     {37,     555235783,    363373950,    555241704,    363384180},
     {38,     555235783,    363384180,    555241704,    363394410},
     {39,     555235783,    363394410,    555241704,    363404640},
     {40,     555235783,    363404640,    555241704,    363414870},
     {41,     555235783,    363414870,    555241704,    363425100},
     {42,     555235783,    363425100,    555241704,    363435330},
     {43,     555235783,    363435330,    555241704,    363445560},
},
{
     {44,     555241704,    363333030,    555247625,    363343260},
     {45,     555241704,    363343260,    555247625,    363353490},
     {46,     555241704,    363353490,    555247625,    363363720},
     {47,     555241704,    363363720,    555247625,    363373950},
     {48,     555241704,    363373950,    555247625,    363384180},
     {49,     555241704,    363384180,    555247625,    363394410},
     {50,     555241704,    363394410,    555247625,    363404640},
     {51,     555241704,    363404640,    555247625,    363414870},
     {52,     555241704,    363414870,    555247625,    363425100},
     {53,     555241704,    363425100,    555247625,    363435330},
     {54,     555241704,    363435330,    555247625,    363445560},
},
{
     {55,     555247625,    363333030,    555253546,    363343260},
     {56,     555247625,    363343260,    555253546,    363353490},
     {57,     555247625,    363353490,    555253546,    363363720},
     {58,     555247625,    363363720,    555253546,    363373950},
     {59,     555247625,    363373950,    555253546,    363384180},
     {60,     555247625,    363384180,    555253546,    363394410},
     {61,     555247625,    363394410,    555253546,    363404640},
     {62,     555247625,    363404640,    555253546,    363414870},
     {63,     555247625,    363414870,    555253546,    363425100},
     {64,     555247625,    363425100,    555253546,    363435330},
     {65,     555247625,    363435330,    555253546,    363445560},
},
{
     {66,     555253546,    363333030,    555259467,    363343260},
     {67,     555253546,    363343260,    555259467,    363353490},
     {68,     555253546,    363353490,    555259467,    363363720},
     {69,     555253546,    363363720,    555259467,    363373950},
     {70,     555253546,    363373950,    555259467,    363384180},
     {71,     555253546,    363384180,    555259467,    363394410},
     {72,     555253546,    363394410,    555259467,    363404640},
     {73,     555253546,    363404640,    555259467,    363414870},
     {74,     555253546,    363414870,    555259467,    363425100},
     {75,     555253546,    363425100,    555259467,    363435330},
     {76,     555253546,    363435330,    555259467,    363445560},
},
{
     {77,     555259467,    363333030,    555265388,    363343260},
     {78,     555259467,    363343260,    555265388,    363353490},
     {79,     555259467,    363353490,    555265388,    363363720},
     {80,     555259467,    363363720,    555265388,    363373950},
     {81,     555259467,    363373950,    555265388,    363384180},
     {82,     555259467,    363384180,    555265388,    363394410},
     {83,     555259467,    363394410,    555265388,    363404640},
     {84,     555259467,    363404640,    555265388,    363414870},
     {85,     555259467,    363414870,    555265388,    363425100},
     {86,     555259467,    363425100,    555265388,    363435330},
     {87,     555259467,    363435330,    555265388,    363445560},
}
};

struct AreaList_t {
    uint8_t Restriction[18];    // Bit-coded restrictions
    void Init(void);
#ifdef NUTE_MODE_TIXE
    bool CoordToAreaIndx(int32_t ALatitude, int32_t ALongitude, uint8_t *PIndx);
    bool IsAreaRestricted(uint32_t AIndx);
#endif
} PACKED;

extern AreaList_t AreaList;


#endif /* AREAS_H_ */

